%Creates one big cluster

cluster_size = 1000;
C = create_cluster([0,0]', [10, 10]', cluster_size);
scatter(C(1,:), C(2,:), 'filled');
axis equal;
title('Generated data set')
generated_class = ones(cluster_size,1);

clusters_num = 4;

%K-means
for k=2:clusters_num
    figure;
    class = kmeans(C', k, 'replicates', 6);
    scatter(C(1,:), C(2,:),[], class', 'filled');
    axis equal;
    t = sprintf('K-Means results. %d clusters', k);
    title(t);
end
disp(size(class));

%Hierarchical FN
for k=2:clusters_num
    figure;
    class = clusterdata(C', 'maxclust', k, 'linkage', 'complete');
    scatter(C(1,:), C(2,:),[], class', 'filled');
    axis equal;
    t = sprintf('Hierarchical FN results. %d clusters', k);
    title(t);
end


%Hierarchical NN
for k=2:clusters_num
    figure;
    class = clusterdata(C', 'maxclust', k, 'linkage', 'single');
    scatter(C(1,:), C(2,:),[], class', 'filled');
    axis equal;
    t = sprintf('Hierarchical NN results. %d clusters', k);
    title(t);
end
